﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;
using VacationDaysCommons;
using VacationDaysDatabase;

namespace VacationDays
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the class name "Service1" in code, svc and config file together.
    [ServiceBehavior(InstanceContextMode = InstanceContextMode.PerCall, ConcurrencyMode = ConcurrencyMode.Multiple)]
    public class VDRequestService : IVDRequestService
    {
        public List<VDVacationRequest> GetPendingRequestsByPM(Guid PMId)
        {
            return DataAccess.Instance.GetPendingRequestsByPM(PMId);
        }

        public List<int> UpdateRequests(List<VDVacationRequest> requestsToUpdate)
        {
            return DataAccess.Instance.TryUpdateRequests(requestsToUpdate);
        }
        public bool CreateVacationRequest(VDVacationRequest newRequest)
        {
            return DataAccess.Instance.TryCreateVacationRequest(newRequest);
        }

        public List<VDVacationRequest> GetEmployeeRequests(Guid userId)
        {
            return DataAccess.Instance.GetEmployeeVacationRequests(userId);
        }
        
        public List<int> CancelVacationRequests(List<int> requestsToCancel)
        {
            return DataAccess.Instance.TryCancelVacationRequests(requestsToCancel);
        }
       
    }
}
